function like(distance) {
	var btBar = document.getElementById("btBar");
	var like = document.createElement("p");
	var node = document.createTextNode("+1");
	like.style.position = "absolute";
	like.style.opacity = "0.0";
	like.style.bottom = "5px";
	like.style.right = distance + "px";
	like.style.fontSize = "12px";
	like.style.lineHeight = "60px";
	like.style.color = "rgba(255,255,255,1.00)";
	like.style.transition = "all 1s";
	like.style.animation = "like 2s";
	like.appendChild(node);
	btBar.appendChild(like);
}

function openRightMenu() {
	document.getElementById("right-menu").style.right = 0 + "px";
	document.getElementById("mask").style.display = "block";
	document.getElementById("menu").style.transform = "rotate(180deg)";
	document.getElementById("menu").style.webkitTransform = "rotate(180deg)";
	document.getElementById("menu").style.MozTransform = "rotate(180deg)";
	document.getElementById("menu").style.msTransform = "rotate(180deg)";
	document.getElementById("menu").style.oTransform = "rotate(180deg)";
	var navItems = document.getElementById("nav-items");
	navItems.style.opacity = 1.0;
	navItems.style.paddingLeft = 0 + "px";
}

function closeRightMenu() {
	document.getElementById("right-menu").style.right = -300 + "px";
	document.getElementById("mask").style.display = "none";
	document.getElementById("menu").style.transform = "rotate(45deg)";
	document.getElementById("menu").style.webkitTransform = "rotate(45deg)";
	document.getElementById("menu").style.MozTransform = "rotate(45deg)";
	document.getElementById("menu").style.msTransform = "rotate(45deg)";
	document.getElementById("menu").style.oTransform = "rotate(45deg)";
	var navItems = document.getElementById("nav-items");
	navItems.style.opacity = 0.0;
	navItems.style.paddingLeft = 50 + "px";
}

var spFlag = true;

function floatSp() {
	var index = 0;
	var spList = document.getElementsByClassName("special");
	var timeSP = window.setInterval(function () {
		if (index < 4) {
			spList[index].style.opacity = 0.50;
			spList[index].style.marginTop = 0 + "px";
			spList[index].style.marginBottom = 40 + "px";
			index++;
		} else {
			window.clearInterval(timeSP);
		}
	}, 100);
}

function overSP(obj) {
	obj.style.opacity = 1.00;
}

function outSp(obj) {
	obj.style.opacity = 0.50;
}

window.onscroll = function () {
	if (spFlag) {
		var p = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
		var h = window.innerHeight ||
			document.documentElement.clientHeight ||
			document.body.clientHeight;
		if (p >= h / 1.5) {
			spFlag = false;
			floatSp();
		}
	}
}

function randomNum(minNum, maxNum) {
	switch (arguments.length) {
		case 1:
			return parseInt(Math.random() * minNum + 1, 10);
			break;
		case 2:
			return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
			break;
		default:
			return 0;
			break;
	}
}

function star() {
	var footAnimate = document.getElementById("footBox");
	var w = window.innerWidth ||
		document.documentElement.clientWidth ||
		document.body.clientWidth;
	var h = window.innerHeight ||
		document.documentElement.clientHeight ||
		document.body.clientHeight;
	footAnimate.innerHTML = "";
	for (var i = 0; i < 300; i++) {
		var pick = document.createElement("div");
		var boxWidth = randomNum(1.1, 2.5);
		pick.style.width = boxWidth + "px";
		pick.style.height = boxWidth + "px";
		pick.style.left = randomNum(0, w - 30) + "px";
		pick.style.top = randomNum(0, h * 0.6) + "px";
		pick.style.position = "absolute";
		pick.style.borderRadius = "5px";
		pick.style.transformStyle = "preserve-3d";
		pick.style.backgroundColor = "rgba(250, 250, 250, 1.00)";
		pick.style.animation = "drop1 " + randomNum(10.0, 100.0) + "s infinite alternate";
		footAnimate.appendChild(pick);
	}
}

window.onload = function () {
	document.getElementById("head_div").style.opacity = 1.0;
	star();
}